<?php

namespace App\Http\Requests\Backend;

class SpaceSchemeRequest extends BaseRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'title' => 'required',
            'thumb' => 'required',
            'sort' => 'required',
            'is_show' => 'required',
            'is_recommend' => 'required',
            'acreage' => 'required',
        ];
    }

    public function messages()
    {
        return [
            'title.required' => '请输入标题',
            'thumb.required' => '请输入封面',
            'sort.required' => '请输入排序',
            'is_show.required' => '请选择是否显示',
            'is_recommend.required' => '请选择是否推荐',
            'acreage.required' => '请填写面积',
        ];
    }

    public function filldata()
    {
        return [
            'title' => $this->input('title'),
            'thumb' => $this->input('thumb'),
            'sort' => $this->input('sort'),
            'is_show' => $this->input('is_show'),
            'is_recommend' => $this->input('is_recommend'),
            'acreage' => $this->input('acreage'),
        ];
    }
}
